package model

// User 用户管理
type User struct {
	Current
	Username          string `json:"username" gorm:"type:varchar(20);comment:'用户名'"`
	Nickname          string `json:"nickname" gorm:"type:varchar(50);comment:'昵称'"`
	Name              string `json:"name" gorm:"type:varchar(50);comment:'姓名'"`
	IdCard            string `json:"id_card" gorm:"type:varchar(50);comment:'身份证号'"`
	Avatar            string `json:"avatar" gorm:"type:varchar(255);comment:'头像'"`
	Mobile            string `json:"mobile" gorm:"type:varchar(11);comment:'手机'"`
	LastLoginTime     int    `json:"last_login_time" gorm:"type:varchar(50);comment:'登录时间'"`
	LastLoginIp       string `json:"last_login_ip" gorm:"type:varchar(20);comment:'登录IP'"`
	Password          string `json:"password" gorm:"type:varchar(50);comment:'密码'"`
	Status            string `json:"status" gorm:"type:enum('1','0');comment:'状态:0=禁用,1=启用'"`
	GroupId           int    `json:"group_id" gorm:"type:int;comment:'权限分组 角色id'"`
	Gender            string `json:"gender" gorm:"type:enum('1','0');comment:'性别:0=女,1=男'"`
	PoliticalStatusId int    `json:"political_status_id" gorm:"type:int;comment:'政治面貌id'"`
	Openid            string `json:"openid"`
	Unionid           string `json:"unionid"`
	TissueId          int    `json:"tissue_id"`
	TissueIds         string `json:"tissue_ids"`
	IsAdmin           string `json:"is_admin"`
	Qrcode            string `json:"qrcode" gorm:"-"`
	Code              string `json:"code" gorm:"-"`
	Token             string `json:"token" gorm:"-"`
	ExpiresAt         int    `json:"expires" gorm:"-"` //token 过期时间
}

func (User) TableName() string {
	return "user"
}
